<!DOCTYPE html>
<html xmlns:wb="http://open.weibo.com/wb">
<head>
    <meta charset="UTF-8">
    <title>@yield('title')</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="{{ asset('/img/bitbug_favicon.ico') }}" />
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js" type="text/javascript" charset="utf-8"></script>
    <link  rel="stylesheet" href="{{ asset('/static/css/common.css') }}">
    @yield('css')
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?b25f763d04df0bfcaa489feaafe72d67";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">
                跟你说晚安
            </a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                @if( $nav_num==0 )
                    <li class="active"><a href="/">首页</a></li>
                    <li><a href="/picture">趣图</a></li>
                    <li><a href="/story">睡前小故事</a></li>
                    <li><a href="/test">小测试</a></li>
                @elseif( $nav_num==1 )
                    <li><a href="/">首页</a></li>
                    <li class="active"><a href="/picture">趣图</a></li>
                    <li><a href="/story">睡前小故事</a></li>
                    <li><a href="/test">小测试</a></li>
                @elseif( $nav_num==2 )
                    <li><a href="/">首页</a></li>
                    <li><a href="/picture">趣图</a></li>
                    <li class="active"><a href="/story">睡前小故事</a></li>
                    <li><a href="/test">小测试</a></li>
                @elseif( $nav_num==3 )
                    <li><a href="/">首页</a></li>
                    <li><a href="/picture">趣图</a></li>
                    <li><a href="/story">睡前小故事</a></li>
                    <li class="active"><a href="/test">小测试</a></li>
                @else
                    <li><a href="/">首页</a></li>
                    <li><a href="/picture">趣图</a></li>
                    <li><a href="/story">睡前小故事</a></li>
                    <li><a href="/test">小测试</a></li>
                @endif
            </ul>
            <ul class="nav navbar-nav navbar-right">
                @if( Session::get('user')==null)
                    <li><a data-toggle="modal" href="#" data-target="#myModal">登录</a></li>
                @endif
                @if( Session::get('user')!=null)
                    <li>
                        <img src="{{ Session::get('user')->avatar }}" style="width:30px;height:30px;margin-top:10px;" class="img-circle"/>
                    </li>
                    <li>
                        <a id="dLabel" data-target="#" href="http://example.com" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ Session::get('user')->name }}<span class="caret"></span></a>
                        <ul class="dropdown-menu" aria-labelledby="dLabel">
                            <li><a href="#">我的主页</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="/loginout">退出</a></li>
                        </ul>
                    </li>
                @endif
            </ul>
        </div><!-- /.navbar-collapse -->
    </div>
</nav>
<!-- 下拉框 -->
<div class="modal fade bs-example-modal-xs" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12 col-xs-12" style="margin-top:20px;">社交帐号登录</div>
                    <div class="col-md-12 col-xs-12" style="margin-top:20px;">
                        <div class="col-md-2 col-xs-4" style="background:#4bc0f1;height:40px;text-align:center">
                            <img src="{{ asset('/static/img/qq-4.png') }}" class="login_img"/>
                        </div>
                        <div class="col-md-10 col-xs-8 login_button" style="background:#4bc0f1;padding-left:30px;cursor:pointer;" onclick="login_qq()">
                            使用 QQ 登录
                        </div>
                    </div>
                    <div class="col-md-12 col-xs-12" style="margin-top:20px;">
                        <div class="col-md-2 col-xs-4" style="background:#ea633b;height:40px;text-align:center">
                            <img src="{{ asset('/static/img/微博.png') }}" class="login_img"/>
                        </div>
                        <div class="col-md-10 col-xs-8 login_button" style="background:#ea633b;padding-left:30px;cursor:pointer;" onclick="login_weibo()">
                            使用 微博 登录
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@yield('content')
<div class="col-md-12 col-xs-12 footer" style="margin:0px;padding:0px;">
    <div class="footer-left">
        <div class="col-md-12 col-xs-12 footer-left-top">
            <a href="/about">关于我们</a>&nbsp;&nbsp;
            广告合作&nbsp;&nbsp;
            违规举报&nbsp;&nbsp;
            感谢有你&nbsp;&nbsp;
            网站地图&nbsp;&nbsp;
            <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1264261591'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1264261591%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>
        </div>
        <div class="footer-left-bottom">
           &copy;2015 - 2017 All Rights Reserved&nbsp;|&nbsp;<a href="http://www.beian.miit.gov.cn/">陕ICP备1500496号-1</a>
        </div>
    </div>
</div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
@yield('script')
<script>
    function login_qq(){
        window.location="/auth/qq";
    }
    function login_weibo(){
        window.location="/auth/weibo";
    }
    $('#username').hover(function () {
        $('#username').css('color','#706257');
    },function () {
        $('#username').css('color','#9b8878');
    });
    $('#comment').hover(function () {
        $('#comment').css('color','#3a1703');
    },function () {
        $('#comment').css('color','#999999');
    });
</script>
<script>
    /*百度索引*/
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>
</html>
